<template>
  <div class="phonePicture">
    <div class="item" v-for="(item, index) in props.materialsInfo">
      <el-image class="send_image" :src="item.imgUrl" alt="" fit="cover">
        <template #error>
          <el-image class="send_image" src="/static/file/pic.png" alt=""></el-image>
        </template>
      </el-image>
      <el-icon class="del" @click="del(index)"><delete /></el-icon>
    </div>
  </div>
</template>

<script setup lang='ts'>
import {reactive, ref, computed, watch, onMounted, defineProps} from "vue"
import {useRouter, useRoute} from "vue-router"
import MessageModel from './MessageModel.vue'

const props = defineProps(['materialsInfo'])

const emit = defineEmits(['del'])

const del = (index: number) => {
  emit('del', index)
}
onMounted(()=>{
  // console.log('props.materialsInfo - -   ', props.materialsInfo)

})

</script>

<style lang="scss" scoped>
.phonePicture {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 8px;
  row-gap: 8px;
  // grid-template-rows: repeat(60px);
  // grid-auto-rows: 60px;
  justify-content: space-between;
  .item{
    height: 72px;
    margin-bottom: 5px;
    position: relative;
    .send_image {
      width: 100%;
      height: 100%;
      object-fit: scale-down;
    }
    .del{
      position: absolute;
      top: 6px;
      right: 6px;
      font-size: 16px;
      background-color: #fafafa;
      height: 24px;
      width: 24px;
      text-align: center;
      line-height: 28px;
      border-radius: 50%;
      color: #888;
      &:hover{
        cursor: pointer;
        color: #fff;
        background-color: #F96B02;
      }
    }
  }
}
</style>
